<template>
  <div class="userinfo">
    <NavBar></NavBar>
    <div class="bg">
      <img class="bg" src="../assets/head.jpg">
    </div>
    <user-detail :userInfo="model"/>
  </div>
</template>

<script>
  import NavBar from "../components/common/NavBar";
  import UserDetail from "../components/userComponent/userDetail";

  export default {
    data(){
      return{
        model:''
      }
    },
    components: {UserDetail, NavBar},
    methods:{
      async userinfoData(){
         const res=await this.$http.get('/user/'+localStorage.getItem('id'))
        this.model=res.data[0]
      }
    },
    created() {
      this.userinfoData()
    }
  }
</script>

<style scoped lang="less">
  .userinfo {
    .bg{
      height: 24vw;
      width: 100%;
    }
  }
</style>
